package com.squareup.timessquare;

import ohos.agp.render.render3d.BuildConfig;
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;

/**
 * Log utility class to handle the log tag and DEBUG-only logging.
 */
final class Logr {
    private static final String TAG_LOG = "DexterLogUtil";

    private static final int DOMAIN_ID = 0xD000F00;

    private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, DOMAIN_ID, TAG_LOG);

    private static final String LOG_FORMAT = "%{public}s: %{public}s";

    /**
     * debug log
     * @param message message
     */
    public static void debug(String message) {
        if (BuildConfig.DEBUG) {
            HiLog.debug(LABEL_LOG, LOG_FORMAT, TAG_LOG, message);
        }
    }

    /**
     * debug
     * @param message message
     * @param args args
     */
    public static void debug(String message, Object... args) {
        if (BuildConfig.DEBUG) {
            debug(String.format(message, args));
        }
    }
}
